import { createGetRequest, createPostRequest } from '@/utils/request'
import { ListResult } from '@/interfaces/userManager'
// 添加用户
const addUser = async (values) => {
    return await createPostRequest('/user/add', values)
}

// 获取患者列表
const getUserList = async (params): Promise<ListResult> => {
    return await createGetRequest('/user/list', params)
}

// 删除用户
const deleteUser = async (id) => {
    return await createPostRequest('/user/delete', { jobnumber: id })
}

// 修改角色
const changeRole = async (id, role) => {
    return await createPostRequest('/user/changeRole', { jobnumber: id, ...role })
}

export {
    addUser,
    getUserList,
    deleteUser,
    changeRole
}